﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPage.Master" AutoEventWireup="true" CodeBehind="RegraCadastro.aspx.cs" Inherits="PopPromotoraCallCenter.Admin.RegraCadastro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadElements" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentElements" runat="server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btnGravar" />
        </Triggers>
        <ContentTemplate>
            <nav class="titleFilter">
                <ul>
                    <li>
                        <h1>Regras</h1>
                        <ul class="formFillButton" style="width: 120px">
                            <asp:Button ID="btnNovo" runat="server" Text="Nova Regra" CssClass="BotaoForm" OnClick="btnNovo_Click" />
                        </ul>
                    </li>
                </ul>
            </nav>
            <asp:HiddenField ID="hfRegraId" runat="server" Value="0" />
            <asp:MultiView ID="mvRegra" runat="server" ActiveViewIndex="0">
                <asp:View runat="server" ID="View1">

                    <br />
                    <asp:Label ID="lblMsgGrid" runat="server" Text="" CssClass="msgErro"></asp:Label><br />
                    <asp:GridView ID="gvRegra" runat="server"
                        DataKeyNames="idRegraCallCenter,fgAtivo" AutoGenerateColumns="False" CellPadding="4"
                        OnRowCommand="gvRegra_RowCommand" OnRowDataBound="gvRegra_RowDataBound" CssClass="report">
                        <Columns>
                            <asp:BoundField HeaderText="Nome" DataField="NomeRegra" />
                            <asp:BoundField HeaderText="Descrição" DataField="DescricaoRegra" />
                            <asp:BoundField HeaderText="Status" DataField="fgAtivo" />
                            <asp:TemplateField HeaderText="Editar">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnEditar" runat="server" CssClass="BotaoForm"
                                        CommandArgument='<%# Eval("idRegraCallCenter") %>' CommandName="editar" ToolTip="Editar" ImageUrl="../Styles/Images/editar.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Desabilitar">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnStatus" runat="server" CssClass="BotaoForm"
                                        CommandArgument='<%# Container.DataItemIndex %>' CommandName="status" ToolTip="Desabilitar" ImageUrl="../Styles/Images/desabilitar.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Excluir">
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:ImageButton ID="btnExcluir" runat="server" CssClass="BotaoForm"
                                        CommandArgument='<%# Eval("idRegraCallCenter") %>' CommandName="excluir" ToolTip="Excluir" ImageUrl="../Styles/Images/lixeira.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                </asp:View>
                <asp:View runat="server" ID="View2">
                    <div class="formFill">
                        <table>
                            <tr>
                                <th>
                                    <label>
                                        Nome Regra
                                    </label>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtNomeRegra" CssClass="CampoForm" MaxLength="50" runat="server"></asp:TextBox>
                                </td>
                                <th>
                                    <label>
                                        Ação da regra
                                    </label>
                                </th>
                                <td>
                                    <asp:DropDownList ID="ddlTipoRegra" CssClass="CampoForm" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        Status Incindencia
                                    </label>
                                </th>
                                <td>
                                    <asp:DropDownList ID="ddlStatus" CssClass="CampoForm" runat="server" />
                                </td>
                                <th>
                                    <label>
                                        Descrição
                                    </label>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtDescricaoRegra" CssClass="CampoForm" MaxLength="1000" TextMode="MultiLine" Rows="5" Columns="50" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="text-align:center">
                                    <asp:Button ID="btnGravar" CssClass="BotaoForm" runat="server" Text="Gravar" OnClick="btnGravar_Click" />&nbsp;&nbsp;
                                    <asp:Button ID="btnVoltar" CssClass="BotaoForm" runat="server" Text="Voltar" OnClick="btnVoltar_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <%--<asp:GridView ID="gvIncidencia" runat="server" AutoGenerateColumns="False" 
                                            ShowHeader="False" onrowcommand="gvIncidencia_RowCommand" CellPadding="4" 
                                            ForeColor="#333333" GridLines="None">
                                            <AlternatingRowStyle BackColor="White" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <ul class="ul">
                                                            <li class="li" style="height: 40px;">Quantidade incidência <asp:TextBox ID="txtIncidencia" AutoPostBack="true" OnTextChanged="txt_incidencia_changed" MaxLength="3" Text='<%# Eval("qtd") %>' Width="30" runat="server" CssClass="CampoForm"></asp:TextBox> vez(es)&nbsp;&nbsp;</li>
                                                            <li style="display: table;">
                                                                <asp:TextBox ID="txtDia" AutoPostBack="true" OnTextChanged="txt_incidencia_changed" runat="server" Width="30" MaxLength="3" Text='<%# Eval("dias") %>' CssClass="CampoForm"></asp:TextBox> dias de retorno ao sorteio
                                                                <br />ou<br />
                                                                <asp:CheckBox ID="cbBloqueio" AutoPostBack="true" OnCheckedChanged="txt_incidencia_changed" Checked='<%# Eval("fgBloqueio") %>' runat="server" /> Bloqueia cliente
                                                            </li>
                                                        </ul>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:Button ID="btnExcluir" runat="server" CssClass="BotaoForm" CommandArgument='<%# Eval("idStatusIncidencia") %>' CommandName="excluir" Text="Excluir" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <EditRowStyle BackColor="#7C6F57" />
                                            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                                            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                            <RowStyle BackColor="#E3EAEB" />
                                            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                                            <SortedAscendingCellStyle BackColor="#F8FAFA" />
                                            <SortedAscendingHeaderStyle BackColor="#246B61" />
                                            <SortedDescendingCellStyle BackColor="#D4DFE1" />
                                            <SortedDescendingHeaderStyle BackColor="#15524A" />
                                        </asp:GridView>--%>
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
